<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>vue</title>
  <script src="./js/vue.js"></script>
  <style>
    .title {
      color: red;
    }
  </style>
</head>

<body>
  <div id="app">
    <titlecmp></titlecmp>
  </div>

  <script>
   let returnCmp = Vue.component('titlecmp', {
      data() {
        return {
          title: 'aaa'
        }
      },
      methods: {
        print() {
          console.log(this.title, 'print')
        }
      },
      /* render(h) {
        return h('ul', null, [
          h('li', { class: 'title', on: { click: () => console.log(this.title) } }, '新闻1111'),
          h('li', { class: 'title' }, '新闻2'),
          h('li', { class: 'title' }, '新闻3'),
        ])
      } */
      // 在工程化时它不能用此配置，它没有 
      template: `
        <ul>
          <li class="title" @click="print">新闻1111</li>
        </ul>
      `
    })


    new Vue().$mount('#app')
  </script>
</body>

</html>